package cn.com.jenson.service.system.config;

import cn.com.jenson.service.system.service.SystemInitService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 自动加载修复方法
 */
@Component
public class AutoSystemConfig implements ApplicationRunner {

    @Resource
    private SystemInitService systemInitService;

    /**
     *  初始化<br/>
     * @param args incoming application arguments
     * @throws Exception
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        systemInitService.init();
    }
}
